<template>
	<view class="pl52 pr52">
		<view class="" v-if="from!=1">
			<view class="fs58 fw mt40">密码登陆</view>
			<view class="mobilebox pl40 pr40 mt70">
				<u-input v-model="form.mobile" type="number" :border="false" height="90" placeholder="请输入手机号"/>
			</view>
			<view class="pwdbox pl40 mt30 pr30">
				<u-input v-model="form.loginpass" type="password" :border="false" height="90" placeholder="请输入密码"/>
			</view>
			<view class="flex row-between col-center mt22">
				<text class="fs32" @tap='$jump("/pages/login/register")'>注册</text>
				<text class="fs24" @tap='$jump("/pages/login/forgetPwd")'>忘记密码</text>
			</view>
			
			<view class="mt50 fs30" >
				<u-button type="primary" shape="circle" class="" @click="login">登录</u-button>
			</view>
			<view class="color9 fs26 flex row-center mt40" @tap='$jump("/pages/login/codeLogin")'>验证码登陆</view>
		</view>
	</view>
</template>

<script>
	export default {
		onLoad() {
		},
		data() {
			return {
				form:{
					mobile:'',
					loginpass:'',
				},
				from:''
			};
		},
		methods:{
			login() {
				this.$api.login(this.form).then(res=>{
					this.$msg('登录成功')
					uni.setStorageSync('token',res.data.token.access_token)
					setTimeout(()=>{
						uni.switchTab({
							url:'/pages/home/home'
						})
					},500)	
				})
			}
		}
	}
</script>

<style lang="scss">
page {
	background-color: #FFFFFF;
}
.mobilebox,
.pwdbox {
	width: 100%;
	height: 90rpx;
	background: #F8F8F8;
	border-radius: 50rpx;
	
}
</style>
